:root {
  --light-bar-color: #f0f9eb;
}
.study-plan {
  width: 100%;
  height: 100vh;
  display: flex;
  background-color: var(--second-color);
  color: var(--main-text-color);
  @media (max-width: 768px) {
    .show-phone {
      visibility: visible !important;
    }
    .hidden-phone {
      display: none !important;
    }
    .study-plan-left {
      border: none !important;
      .active {
        background-color: var(--second-color) !important;
      }
    }
  }
  .tag {
    display: inline-block;
    height: 22px;
    padding: 0 10px;
    line-height: 20px;
    font-size: 12px;
    border: 1px solid var(--light-bar-color);
    border-radius: 4px;
    box-sizing: border-box;
    white-space: nowrap;
    background-color: var(--light-bar-color);
    border-color: var(--light-bar-color);
    color: var(--bar-color);
    margin-right: 5px;
  }
  .event-op {
    i {
      cursor: pointer;
      width: 10px;
      height: 10px;
    }
    .edit {
      margin-right: 5px;
    }
  }
  .bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
    padding: 6px 12px;
    background-color: var(--bar-color);
    color: var(--main-color);
    .back {
      visibility: hidden;
    }
  }
  .balloon {
    position: relative;

    &:before,
    &:after {
      bottom: 100%;
      left: 50%;
      transform: translate(-50%, 0);
      position: absolute;
      z-index: 10;
      transition: all 0.18s ease-out 0.18s;
      opacity: 0;
    }

    // body of the balloon
    &:after {
      background-color: var(--bar-color);
      border-radius: 4px;
      color: white;
      content: attr(balloon-data);
      margin-bottom: 12px;
      padding: 10px;
    }

    // tip (triangle) of the balloon
    &:before {
      content: '';
      margin-bottom: 4px;
      border-top: solid 8px var(--bar-color);
      border-left: solid 8px transparent;
      border-right: solid 8px transparent;
    }

    &:hover:before,
    &:hover:after {
      opacity: 1;
    }
  }
  .hidden {
    display: none;
  }
  .study-plan-left {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    border-right: 6px solid var(--main-color);
    cursor: pointer;
    .main {
      flex: 1;
      .plan {
        position: relative;
        padding: 8px 20px;
        border-bottom: 2px solid #f0f0f0;
        h1 {
          display: flex;
          justify-content: space-between;
          align-items: center;
          .date {
            font-size: 12px;
            color: var(--bar-color);
          }
        }
        .date {
          font-size: 14px !important;
        }
        .comment {
          font-size: 12px;
          padding: 5px 0;
        }
        .extra {
          display: flex;
          justify-content: space-between;
          .extra-right {
            display: flex;
            justify-content: flex-end;
          }
        }
      }
      .step {
        padding: 10px;
        .StepProgress {
          position: relative;
          padding-left: 45px;
          list-style: none;
          strong {
            display: block;
          }
          &:before {
            display: inline-block;
            content: '';
            position: absolute;
            top: 0;
            left: 15px;
            width: 10px;
            height: 100%;
            border-left: 2px solid #ccc;
          }
          .StepProgress-item {
            position: relative;
            counter-increment: list;
            &:not(:last-child) {
              padding-bottom: 20px;
            }
            &:before {
              display: inline-block;
              content: '';
              position: absolute;
              left: -30px;
              height: 100%;
              width: 10px;
            }
            &:after {
              content: '';
              display: inline-block;
              position: absolute;
              top: 0;
              left: -37px;
              width: 12px;
              height: 12px;
              border: 2px solid #ccc;
              border-radius: 50%;
              background-color: #fff;
            }
          }
          .is-done {
            &:before {
              border-left: 2px solid var(--bar-color);
            }
            &:after {
              content: '✔';
              font-size: 10px;
              color: #fff;
              text-align: center;
              border: 2px solid var(--bar-color);
              background-color: var(--bar-color);
            }
          }

          .current {
            &:before {
              border-left: 2px solid var(--bar-color);
            }
            &:after {
              content: counter(list);
              padding-top: 1px;
              width: 19px;
              height: 18px;
              top: -4px;
              left: -40px;
              font-size: 14px;
              text-align: center;
              color: var(--bar-color);
              border: 2px solid var(--bar-color);
              background-color: white;
            }
          }
        }
      }
      .right {
        display: flex;
        justify-content: center;
        align-items: center;
      }
      .active {
        background: #ededed;
      }
    }
  }
  .study-plan-right {
    display: flex;
    flex-direction: column;
    flex: 2;
    .main {
      flex: 1;
      .todo-list {
        padding: 20px;
        h1 {
          font-weight: bold;
          border-bottom: 2px solid #f0f0f0;
          padding: 10px 0;
        }
        ul {
          padding: 10px;
          .event {
            display: flex;
            position: relative;
            padding: 10px;
            margin-bottom: 10px;
            background-color: #fff;
            border-radius: 5px;
            .left {
              margin-right: 5px;
              input[type='checkbox'] {
                appearance: none;
                width: 20px;
                height: 20px;
                padding: 3px;
                cursor: pointer;
                border: 2px solid var(--bar-color);
                border-radius: 100%;
                background-clip: content-box;
              }
              input[type='checkbox']:checked {
                background-color: var(--bar-color);
              }
            }
            .right {
              flex: 1;
              .title {
                font-size: 14px;
                line-height: 20px;
              }
              .desc {
                font-size: 14px;
              }
              .info {
                display: flex;
                justify-content: flex-end;
                align-items: center;
                span {
                  line-height: 12px;
                  font-size: 12px;
                  i {
                    color: var(--bar-color);
                  }
                }
              }
            }
            .event-op {
              position: absolute;
              right: 20px;
              top: 50%;
              transform: translateY(-50%);
            }
          }
          .finish {
            .title {
              color: var(--bar-color);
              text-decoration: line-through;
            }
            .desc {
              display: none;
            }
            .event-op {
              display: none;
              font-weight: bold;
              color: var(--bar-color);
              .edit {
                display: none;
              }
            }
            &:hover {
              .event-op {
                display: block;
              }
            }
          }
        }
      }
    }
    .progress-wrap {
      height: 32px;
      position: relative;
      text-align: center;
      line-height: 30px;
      background: #ddd;
      overflow: hidden;
      font-weight: bold;
      span {
        display: block;
        height: 100%;
      }
      .progress {
        background-color: var(--bar-color);
        animation: progressBar 1s ease-in-out;
      }
      .text {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
      }
      @keyframes progressBar {
        0% {
          width: 0;
        }
        100% {
          width: 100%;
        }
      }
    }
  }
}
